<?php
class Newsletter extends AppModel{
    public $useTable  = 'newsletter';
    
    function check_email($email = null)
    {
        $sql = "SELECT * FROM newsletter WHERE email = '$email'";
        $rs = $this->query($sql);
        if(!empty($rs))
            return 0;
        else
            return 1;
    }
    
    function add_newsletter($email = null, $gender = null)
    {
        $sql = "INSERT INTO newsletter values('', '$email', '$gender', now())";
        $this->query($sql);
    }
}